// 1. 导入所需模块
import Vue from 'vue'
import VueRouter from 'vue-router'
import MyHome from '@/components/MyHome.vue'
import MyMovie from '@/components/MyMovie.vue'
import MyAbout from '@/components/MyAbout.vue'
import AboutYou from "@/components/AboutYou";
import AboutMe from "@/components/AboutMe";
import MySports from "@/components/MySports";

// 2. 调用 Vue.use() 函数，将 VueRouter 安装为 Vue 的插件
Vue.use(VueRouter)

// 3. 创建路由的实例对象
const router = new VueRouter({
    routes:[
    { path: '/home', component: MyHome },
    { path: '/movie/:id/:name', component: MyMovie },
    { path: '/about', component: MyAbout,children:[
        {path: 'you',component:AboutYou},
        {path: 'me',component:AboutMe},
    ] },
    { path: '/sport', component: MySports },
]
})

// 4. 导出路由的实例对象
export default router